#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "tableModel.h"		// la nostra tabellona strafiga
#include "rowModel.h"
#include "descriptionTab.h"
#include "filesListTab.h"
#include "terminalTab.h"

//#include "../core/SlackList.h"
#include <kde_terminal_interface.h>

#include <KMainWindow>
#include <KXmlGuiWindow>
#include <KLineEdit>
#include <KToolBar>
#include <KMultiTabBar>
#include <KSqueezedTextLabel>
#include <KPushButton>
#include <KListWidget>
#include <KTabBar>
#include <KTreeWidgetSearchLine>
#include <KAction>

#include <QTreeWidget>
#include <QStatusBar>
#include <QTableView>
#include <QDockWidget>
#include <QSplitter>

class MainWindow: public KXmlGuiWindow {
  Q_OBJECT
public:
  MainWindow(QWidget* parent=0);
  QSplitter* split;
private slots:
  void closeTab(QWidget *widg);
  void fillPackagesList() ;
  void removeClick();
  void updateClick();
  void settingsClick();
  void showDescription();
  void showFiles();
  void showTerm();
  void setActualPackage(QTreeWidgetItem* item);
private:
  KSqueezedTextLabel* searchLabel;
  KTreeWidgetSearchLine* searchField;
  KToolBar* topToolBar;
  KToolBar* bottomToolBar;
  KMultiTabBar* tabBar;

  QStatusBar* statusBar;
  QWidget* preTerminal;
  TerminalTab* terminalTab;
  KAction* removeButton;
  KAction* updateButton;
  KAction* settingsButton;
  PackList* packList;
  //void tabClosed(QWidget *widg);


  #ifdef SLACKWARE
    SlackList* sysPackagesList;
  #endif
  #ifdef APT
    AptList* sysPackagesList;
  #endif

  PackRow* packRow;
  QList<QTreeWidgetItem*> items;
  QTimer* timer;
  DescriptionTab* descriptionTab;
  FilesListTab* filesListTab;
  QString selectedFileName;
  bool removePressed;
  bool rowClicked;
  bool lastPackageFound;
  void setupActions();
  void setList();
  
};
#endif

